#include<linux/module.h>
#include<linux/kernel.h>
#include<linux/init.h>
#include<linux/list.h>
#include<linux/sched.h>
#include<linux/kthread.h>


static int noop(void *dummy)
{
		int i = 0;
    daemonize("mythread");
    while(i++ < 5) {
			printk("current->mm = %p\n", current->mm);
			printk("current->active_mm = %p\n", current->active_mm);
 			set_current_state(TASK_INTERRUPTIBLE);
      schedule_timeout(10 * HZ);
    }
    return 0;
}
static int __init lkp_init(void)
{
	kernel_thread(noop, NULL, CLONE_KERNEL | SIGCHLD);
	return 0; 
}

static void __exit lkp_exit(void)
{
	printk(KERN_ALERT "hello,quit\n"); 
}

module_init(lkp_init); 
module_exit(lkp_exit); 


MODULE_LICENSE("GPL");
